$(function() {
	new Vue({
		el: "#shopListApp",
		data: {
			searchShop:"",
			fullscreenLoading:false,
			currentPage:1,
			totalSize:1,
			tableData: []
		},
		created:function(){
			parent.vueData.$data.hreHtml = "../drawHistory/index.html";
			parent.vueData.activeIndex  = "3";
			parent.vueData.getLeftNav("3")
			parent.vueData.$data.categoryIndex = 4
			this.getExtractList(1);
		},
		methods:{
            getExtractList(page){
				this.fullscreenLoading = true;
				let param = {
					page: page,
				}
				axios({
					url: POSTURL.allExtractMoneyMessage,
					method:'post',
					data: param
				}).then(response => {
					if (response.data.code === 100) {
						this.fullscreenLoading = false;
						if (page === 1) {
							if (response.data.result.page <=1) {
								this.totalSize = response.data.result.integrals.length
							} else {
								this.totalSize = response.data.result.page * 10
							}
							this.tableData.length = 0;
							this.tableData = [];
						}
						console.log(response.data.result);
						this.tableData = this.tableData.concat(response.data.result.integrals)
					} else {
						this.$message.error(response.data.message);
					}
				}).catch(error => {
					this.fullscreenLoading = false;
					console.log(error);
					this.$message.error('服务器出错!');
				}) 
			} ,
			handleCurrentChange(val) {
				 this.getMemberList(val)
			},
			handleConfig(val){
				console.log(val.id);
				this.fullscreenLoading = true;
				axios({
					url: POSTURL.auditExtract,
					method:'post',
					id:val.id
				}).then(response => {
					this.fullscreenLoading = false;
					if (response.data.code === 100) {
						this.$message({
							showClose: true,
							message: response.data.message,
							type: 'success'
						});
					} else {
						this.$message.error(response.data.message);
					}
				}).catch(error => {
					this.fullscreenLoading = false;
					console.log(error);
					this.$message.error('服务器出错!');
				}) 
			}
			
		}
	})
})
